<template>
	<view class="password" :style="{minHeight: wHeight + 'px' }" >
		<view class="password-now">
			<view class="password-now-li">
				<text>当前密码</text>
			</view>
			<view class="password-now-input">
				<input type="text" v-model="oldpassword" placeholder="输入旧密码" />
			</view>
		</view>
		<view class="password-now-o">
			<view class="password-now-li">
				<text>新密码</text>
			</view>
			<view class="password-now-input">
				<input type="text" v-model="newpassword" placeholder="输入旧密码" />
			</view>
		</view>
		<view class="password-now-i">
			<view class="password-now-li">
				<text>确认新密码</text>
			</view>
			<view class="password-now-input">
				<input type="text" v-model="reppassword" placeholder="输入旧密码" />
			</view>
		</view>
		<view class="password-bottom" @click="modify">
			<text>修改密码</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				wHeight: '',
				oldpassword: '',//旧密码
				newpassword: '',//新密码 
				reppassword: '',//重复新密码
			}
		},
		onLoad() {
			this.wHeight = this.$store.state.ContentHeight - 45;
		},
		// 修改密码
		methods:{
			modify(){
				let amend = {
					password: '',
					new_password: '',
					rep_password: '',
				}
				this.$post(this.api.updatepwd, amend).then((res) => {
					console.log(res)
				}).catch((err) => {
					console.log(err)
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	.password {
		background-color: #EFEFEF;
		position: absolute;
		width: 100%;

		.password-now {
			margin-top: 30rpx;
			display: flex;
			background-color: #FFFFFF;
			padding: 32rpx;

			.password-now-li {
				display: flex;
				align-items: center;
				justify-content: center;
				flex-direction: column;

				text {
					font-size: 31rpx;
					font-family: Source Han Sans CN;
					font-weight: bold;
					color: #333333;
				}
			}

			.password-now-input {
				padding-left: 70rpx;
			}
		}

		.password-now-o {
			margin-top: 30rpx;
			display: flex;
			background-color: #FFFFFF;
			padding: 32rpx;

			.password-now-li {
				display: flex;
				align-items: center;
				justify-content: center;
				flex-direction: column;
				text {
					font-size: 31rpx;
					font-family: Source Han Sans CN;
					font-weight: bold;
					color: #333333;
				}
			}

			.password-now-input {
				padding-left: 100rpx;
			}
		}

		.password-now-i {
			display: flex;
			background-color: #FFFFFF;
			padding: 32rpx;

			.password-now-li {
				display: flex;
				align-items: center;
				justify-content: center;
				flex-direction: column;
				text {
					font-size: 31rpx;
					font-family: Source Han Sans CN;
					font-weight: bold;
					color: #333333;
				}
			}

			.password-now-input {
				padding-left: 40rpx;
			}
		}

		.password-bottom {
			width: 686rpx;
			height: 80rpx;
			background: #0099FF;
			border-radius: 13rpx;
			text-align: center;
			line-height: 80rpx;
			margin: 0 auto;
			margin-top: 67rpx;

			text {
				font-size: 33rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: #FFFFFF;
			}
		}
	}
</style>
